package com.qhs.sys.entity;


import com.qhs.framework.base.BaseModel;
import com.qhs.sys.vo.MenuVO;
import org.hibernate.validator.constraints.NotEmpty;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

@Table(name = "sys_user_info")
public class SysUserInfo extends BaseModel{

    @Column(name="user_name",length = 40,nullable = false,unique =true)
    @NotEmpty(message="用户名不能为空")
    private String userName;
    @Column(name="salt",length = 100,nullable = false)
    private String salt;
    @Column(name="password",length = 128,nullable = false)
    private String password;
    @Column(name="nick_name",length = 100,nullable = false)
    private String nickName;
    @Column(name="phone",length = 19,nullable = false)
    private Long phone;
    @Column(name="status",length = 4,nullable = false)
    private Integer status;
    @Column(name="sort",length = 4,nullable = false)
    private Integer sort;
    @Column(name="memo",length = 200)
    private String memo;
    @Column(name="user_type",length = 4,nullable = false)
    private Integer userType;

    @Transient
    private List<MenuVO> authMenu;


    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt == null ? null : salt.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName == null ? null : nickName.trim();
    }

    public Long getPhone() {
        return phone;
    }

    public void setPhone(Long phone) {
        this.phone = phone;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo == null ? null : memo.trim();
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }


    public List<MenuVO> getAuthMenu() {
        return authMenu;
    }

    public void setAuthMenu(List<MenuVO> authMenu) {
        this.authMenu = authMenu;
    }
}